package com.xh.amqp.runner;

import com.xh.amqp.service.IBookService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Name ApplicationRunner
 * @Description
 * @Author wen
 * @Date 2019-05-05
 */
@Slf4j
@Order(1)
@Component
public class InitializationRunner implements ApplicationRunner {

    @Autowired
    private IBookService bookService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        //初始化RabbitMQ的邮件配置
        bookService.createEmailMQ(true);
    }



}
